//
//  NextDetailViewController.m
//  PTravel
//
//  Created by dllo on 15/11/15.
//  Copyright © 2015年 李涵. All rights reserved.
//

#import "NextDetailViewController.h"

@interface NextDetailViewController ()<UIWebViewDelegate>

@end

@implementation NextDetailViewController

- (void)dealloc
{
    [_progress release];
    [_juhua release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    NSString *urlStr = [NSString stringWithFormat:@"%@",self.url];
    NSURL *url = [NSURL URLWithString:urlStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    UIWebView *webView = [[UIWebView alloc] initWithFrame:BOUNDS];
    [self.view addSubview:webView];
    [webView loadRequest:request];
    webView.delegate = self;
    self.juhua.hidesWhenStopped = YES;
    self.navigationItem.title = self.titleName;
    
}

#pragma mark === 页面开始加载的时候
-(void)webViewDidStartLoad:(UIWebView *)webView{
    
    [self.progress setProgress:0 animated:false];
    [self.juhua startAnimating];
}
#pragma mark === 页面加载结束
-(void)webViewDidFinishLoad:(UIWebView *)webView{
    
    [self.progress setProgress:1 animated:YES];
    [self.juhua stopAnimating];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
